feat: Parse and use retryDelay from Google API RateLimitExceeded errors#4124
Merged
jamadeo merged 6 commits intoblock:mainfrom Sep 25, 2025
Merged
feat: Parse and use retryDelay from Google API RateLimitExceeded errors#4124jamadeo merged 6 commits intoblock:mainfrom
jamadeo merged 6 commits intoblock:mainfrom
Conversation
ac6ded9 to
44634fa
Compare
jamadeo
approved these changes
Aug 18, 2025
Collaborator
jamadeo
left a comment
There was a problem hiding this comment.
Looks great, thank you!
| .await?; | ||
|
|
||
| // Parse response | ||
| let message = response_to_message(unescape_json_values(&response))?; |
Collaborator
There was a problem hiding this comment.
is this now unused? feel free to delete it from utils.rs if so
Contributor
Author
There was a problem hiding this comment.
Sorry, this was an accidental change, removed.
crates/goose/src/providers/retry.rs
Outdated
| ); | ||
|
|
||
| let delay = config.delay_for_attempt(attempts); | ||
| let delay = if let ProviderError::RateLimitExceeded { retry_delay, .. } = &error { |
Collaborator
There was a problem hiding this comment.
you can simplify to
let delay = match &error {
ProviderError::RateLimitExceeded {
retry_delay: Some(provider_delay),
..
} => *provider_delay,
_ => config.delay_for_attempt(attempts),
};
losing the debug but that doesn't seem terribly important to keep
Contributor
Author
There was a problem hiding this comment.
OK, done.
Collaborator
|
@sings-to-bees-on-wednesdays this is good to go, just needs lint + format issues addressed. To format, use |
9f557cd to
6cce190
Compare
Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com>
Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com>
6cce190 to
be67a92
Compare
Contributor
Author
|
Thanks, fixed and rebased. |
Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com>
Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com>
be67a92 to
dc741c0
Compare
Collaborator
|
sorry about the delay, can you resolve the conflicts? |
katzdave
added a commit
that referenced
this pull request
Sep 25, 2025
…ovements * 'main' of github.com:block/goose: (23 commits) blog post on subagents vs subrecipes (#4829) fix chat button alignment and spacing for attachments (#4794) fix: remove nested double quotes in windows automation_script tool description (#4824) fix: a few things with the mcp snapshot test (#4818) Revert "fix(compaction): try to catch more context limit exceeded erors and compact" (#4820) test: add test coverage for Tools Inspector (#4700) feat: Parse and use retryDelay from Google API RateLimitExceeded errors (#4124) cleanup: remove unused link preview and goose response form components (#4795) fix build: latest bedrock version (#4812) prefer users SHELL (#4702) feat: update aws-sdk-bedrockruntime to enable AWS_BEARER_TOKEN_BEDROCK auth (#4327) correct the tests from an odd merge (#4804) docs: import yaml recipe (#4799) docs: Add openmetadata extension to goose mcp docs (#4547) Add elapsed time to the CLI output. (#4609) fix: Fix cell coordinate ordering in XlsxTool and add unit tests (#4551) Use gemini flash for summarization on open router (#4290) chore(deps): bump xcb from 1.5.0 to 1.6.0 (#4289) feat(shell): throw errors on interactive commands (#4788) feat: AgentManager - foundation for unified execution (#4389) (#4684) ...
HikaruEgashira
pushed a commit
to HikaruEgashira/goose
that referenced
this pull request
Oct 3, 2025
…rs (block#4124) Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com> Co-authored-by: Jack Amadeo <jackamadeo@block.xyz> Co-authored-by: Jack Amadeo <jackamadeo@squareup.com> Signed-off-by: HikaruEgashira <hikaru-egashira@c-fo.com>
This was referenced Oct 8, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we exceed the TPM rate limit with the Google API, it helpfully includes a duration for how long to wait before we can safely try again. Let's grab that and use it instead of our existing back-off logic when it's present.